﻿namespace WMS6.Web.Inventory
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class InvTransQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlCreatedBy;
        protected DropDownList ddlCreatedDate;
        protected DropDownList ddlDocIDOper;
        protected DropDownList ddlExpiryDateOper;
        protected DropDownList ddlExternalLotOper;
        protected DropDownList ddlFromLoc;
        protected DropDownList ddlFromLpn;
        protected DropDownList ddlLot;
        protected DropDownList ddlLotAttribute01;
        protected DropDownList ddlLotAttribute02;
        protected DropDownList ddlLotAttribute03;
        protected DropDownList ddlLotAttribute04;
        protected DropDownList ddlLotAttribute05;
        protected DropDownList ddlLotAttribute06;
        protected DropDownList ddlLotAttribute07;
        protected DropDownList ddlLotAttribute08;
        protected DropDownList ddlLotAttribute09;
        protected DropDownList ddlLotAttribute10;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlProduceDateOper;
        protected DropDownList ddlReceiptDateOper;
        protected DropDownList ddlSkuID;
        protected DropDownList ddlSourceTransTypeOper;
        protected DropDownList ddlToLoc;
        protected DropDownList ddlToLpn;
        protected DropDownList ddlTransTypeOper;
        protected DropDownList ddlVendorIDOper;
        protected HtmlForm F5020;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlImage img2;
        protected HtmlImage img5;
        protected Label lblCreatedBy;
        protected Label lblCreatedDate;
        protected Label lblDocID;
        protected Label lblExpiryDate;
        protected Label lblExternalLot;
        protected Label lblFromLoc;
        protected Label lblFromLpn;
        protected Label lblLot;
        protected Label lblLotAttribute02;
        protected Label lblLotAttribute03;
        protected Label lblLotAttribute04;
        protected Label lblLotAttribute05;
        protected Label lblLotAttribute06;
        protected Label lblLotAttribute07;
        protected Label lblLotAttribute08;
        protected Label lblLotAttribute09;
        protected Label lblLotAttribute1;
        protected Label lblLotAttribute10;
        protected Label lblOwnerID;
        protected Label lblProduceDate;
        protected Label lblReceiptDate;
        protected Label lblSkuID;
        protected Label lblSourceTransType;
        protected Label lblToLoc;
        protected Label lblToLpn;
        protected Label lblTransTyep;
        protected Label lblVendorID;
        protected MultipleSelectControl MSCSourceTransType;
        protected MultipleSelectControl MSCTransType;
        protected HtmlLink mycss;
        protected Label one1;
        protected Label one2;
        protected TextBox txtCreatedBy;
        protected TextBox txtCreatedDate;
        protected TextBox txtCreatedDate2;
        protected TextBox txtDocID;
        protected TextBox txtExpiryDate;
        protected TextBox txtExternalLot;
        protected TextBox txtFromLoc;
        protected TextBox txtFromLpn;
        protected TextBox txtLot;
        protected TextBox txtLotAttribute01;
        protected TextBox txtLotAttribute02;
        protected TextBox txtLotAttribute03;
        protected TextBox txtLotAttribute04;
        protected TextBox txtLotAttribute05;
        protected TextBox txtLotAttribute06;
        protected TextBox txtLotAttribute07;
        protected TextBox txtLotAttribute08;
        protected TextBox txtLotAttribute09;
        protected TextBox txtLotAttribute10;
        protected TextBox txtOwnerID;
        protected TextBox txtProduceDate;
        protected TextBox txtReceiptDate;
        protected TextBox txtReceiptDate2;
        protected TextBox txtSkuID;
        protected TextBox txtToLoc;
        protected TextBox txtToLpn;
        protected TextBox txtVendorID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("InvTransList.aspx", false);
        }

        private void LoadDDl()
        {
            base.InitQueryDDL(this.ddlCreatedBy, 0);
            base.InitQueryDDL(this.ddlCreatedDate, 1);
            base.InitQueryDDL(this.ddlLot, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlDocIDOper, 0);
            base.InitQueryDDL(this.ddlFromLoc, 0);
            base.InitQueryDDL(this.ddlToLoc, 0);
            base.InitQueryDDL(this.ddlFromLpn, 0);
            base.InitQueryDDL(this.ddlToLpn, 0);
            base.InitQueryDDL(this.ddlTransTypeOper, 0);
            base.InitQueryDDL(this.ddlSourceTransTypeOper, 0);
            base.InitQueryDDL(this.ddlVendorIDOper, 0);
            base.InitQueryDDL(this.ddlProduceDateOper, 1);
            base.InitQueryDDL(this.ddlExternalLotOper, 0);
            base.InitQueryDDL(this.ddlExpiryDateOper, 1);
            base.InitQueryDDL(this.ddlReceiptDateOper, 1);
            base.InitQueryDDL(this.ddlLotAttribute01, 0);
            base.InitQueryDDL(this.ddlLotAttribute02, 0);
            base.InitQueryDDL(this.ddlLotAttribute03, 0);
            base.InitQueryDDL(this.ddlLotAttribute04, 0);
            base.InitQueryDDL(this.ddlLotAttribute05, 0);
            base.InitQueryDDL(this.ddlLotAttribute06, 0);
            base.InitQueryDDL(this.ddlLotAttribute07, 0);
            base.InitQueryDDL(this.ddlLotAttribute08, 0);
            base.InitQueryDDL(this.ddlLotAttribute09, 0);
            base.InitQueryDDL(this.ddlLotAttribute10, 0);
            base.BindData2DDLBySysCode(this.MSCTransType, "TransType");
            this.ddlTransTypeOper.SelectedValue = "One Of";
            base.BindData2DDLBySysCode(this.MSCSourceTransType, "TransSourceType");
            this.ddlSourceTransTypeOper.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDl();
            }
            this.btnNew.Visible = false;
        }

        public string CreatedBy
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCreatedBy.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCreatedBy.Text.Trim(), this.ddlCreatedBy.SelectedValue);
                }
                return "";
            }
        }

        public string CreatedDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCreatedDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCreatedDate.Text.Trim(), this.ddlCreatedDate.SelectedValue, this.txtCreatedDate2.Text.Trim(), "CreatedDate");
                }
                return "";
            }
        }

        public string DocID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtDocID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtDocID.Text.Trim(), this.ddlDocIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string ExpiryDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExpiryDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExpiryDate.Text, this.ddlExpiryDateOper.SelectedValue);
                }
                return "";
            }
        }

        public string ExternalLot
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternalLot.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternalLot.Text, this.ddlExternalLotOper.SelectedValue);
                }
                return "";
            }
        }

        public string FromLoc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFromLoc.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFromLoc.Text.Trim(), this.ddlFromLoc.SelectedValue);
                }
                return "";
            }
        }

        public string FromLpn
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFromLpn.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFromLpn.Text.Trim(), this.ddlFromLpn.SelectedValue);
                }
                return "";
            }
        }

        public string Lot
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLot.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLot.Text.Trim(), this.ddlLot.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute01
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute01.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute01.Text.Trim(), this.ddlLotAttribute01.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute02
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute02.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute02.Text.Trim(), this.ddlLotAttribute02.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute03
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute03.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute03.Text.Trim(), this.ddlLotAttribute03.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute04
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute04.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute04.Text.Trim(), this.ddlLotAttribute04.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute05
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute05.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute05.Text.Trim(), this.ddlLotAttribute05.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute06
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute06.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute06.Text.Trim(), this.ddlLotAttribute06.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute07
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute07.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute07.Text.Trim(), this.ddlLotAttribute07.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute08
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute08.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute08.Text.Trim(), this.ddlLotAttribute08.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute09
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute09.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute09.Text.Trim(), this.ddlLotAttribute09.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute10
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute10.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute10.Text.Trim(), this.ddlLotAttribute10.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ProduceDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtProduceDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtProduceDate.Text, this.ddlProduceDateOper.SelectedValue);
                }
                return "";
            }
        }

        public string ReceiptDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReceiptDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReceiptDate.Text, this.ddlReceiptDateOper.SelectedValue, this.txtReceiptDate2.Text.Trim(), "ReceiptDate");
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }

        public string SourceTransType
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCSourceTransType.ReturnValue))
                {
                    return base.GetParamsString(this.MSCSourceTransType.ReturnValue, this.ddlSourceTransTypeOper.SelectedValue);
                }
                return "";
            }
        }

        public string ToLoc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtToLoc.Text.Trim()))
                {
                    return base.GetParamsString(this.txtToLoc.Text.Trim(), this.ddlToLoc.SelectedValue);
                }
                return "";
            }
        }

        public string ToLpn
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtToLpn.Text.Trim()))
                {
                    return base.GetParamsString(this.txtToLpn.Text.Trim(), this.ddlToLpn.SelectedValue);
                }
                return "";
            }
        }

        public string TransType
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCTransType.ReturnValue))
                {
                    return base.GetParamsString(this.MSCTransType.ReturnValue, this.ddlTransTypeOper.SelectedValue);
                }
                return "";
            }
        }

        public string VendorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtVendorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtVendorID.Text.Trim(), this.ddlVendorIDOper.SelectedValue);
                }
                return "";
            }
        }
    }
}

